package main

import (
	"github.com/labstack/echo/v4"
	"github.com/labstack/echo/v4/middleware"
)

func main() {
	e := echo.New()
	e.Pre(middleware.HTTPSRedirect()) //http://laily.net 将被重定向到 https://laily.net。
	//e.Pre(middleware.HTTPSWWWRedirect())    //http://laily.net 将被重定向到 https://www.laily.net。
	//e.Pre(middleware.HTTPSNonWWWRedirect()) //http://www.laily.net 将被重定向到 https://laily.net。
	//e.Pre(middleware.WWWRedirect())         //http://laily.net 重定向到 http://www.laily.net
	//e.Pre(middleware.NonWWWRedirect())      //http://www.laily.net 重定向到 http://laily.net

	//自定义配置
	//e.Use(middleware.HTTPSRedirectWithConfig(middleware.RedirectConfig{
	//	Skipper: middleware.DefaultSkipper,
	//	Code:    302,
	//}))

	e.Start(":80")
}
